import http.server
import socketserver

Handler = http.server.SimpleHTTPRequestHandler

with socketserver.TCPServer(("", 8001), Handler) as httpd:
    print("serving at port", 8001)
    httpd.serve_forever()